import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";
import { AxiosPromise } from 'axios'

//用户列表
export function listCommodity(quary){
  return request({
    url:'/commodity/commodity/list',
    method:'get',
    params:quary
  })
}

//新增商品
export function addCommodity(data){
  return request({
    url:'commodity/commodity',
    method:'post',
    data:data
  })
}

export function  getCommodityById(commodityId){
  return request({
    url:`commodity/commodity/${commodityId}`,
    method:'get'
  })
}
export function updateCommodity(data) {
  return request({
    url: '/commodity/commodity',
    method: 'put',
    data: data
  })
}
export function delCommodity(commodityId) {
  return request({
    url: '/commodity/commodity/' + commodityId,
    method: 'delete'
  })
}
